package info.hexin.lang;

import java.io.InputStream;

public class Files {
    /**
     * 从classpath中获取文件
     * 
     * @param fileName
     * @return
     */
    public static InputStream fromClassPath(String fileName) {
        if (!fileName.startsWith("/")) {
            fileName = "/" + fileName;
        }
        return Files.class.getResourceAsStream(fileName);
    }
}
